﻿<!DOCTYPE html>
<html style="overflow-x:hidden;overflow-y:auto;">
	<head>
	<title>登录页面</title>
  	<link rel="stylesheet" href="${base}/static/admin/css/typica-login.css">
  	[#include "/admin/include/header.htm"]
	<style type="text/css">
		.control-group{border-bottom:0px;}
		/*登录验证码图片样式 */
	    .verify{width:80px;height:30px;}
	    .main{margin-top: 200px;}
	</style>
    <script src="${base}/static/admin/js/backstretch.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$.backstretch([
 		      "${base}/static/admin/images/bz1.jpg", 
 		      "${base}/static/admin/images/bz2.jpg",
 		      "${base}/static/admin/images/bz3.jpg",
 		      "${base}/static/admin/images/bz4.jpg", 
		      "${base}/static/admin/images/bz5.jpg",
		      "${base}/static/admin/images/bz6.jpg"
 		  	], {duration: 10000, fade: 2000});
			
			$("#loginForm").validate({
				rules: {
					validateCode: {remote: "${base}/admin/main/validateCode"}
				},
				messages: {
					username: {required: "请填写用户名."},password: {required: "请填写密码."},
					validateCode: {remote: "验证码不正确.", required: "请填写验证码."}
				},
				errorLabelContainer: "#messageBox",
				errorPlacement: function(error, element) {
					error.appendTo($("#loginError").parent());
				} 
			});
			
			var $isRememberUsername = $("#rememberMe");
			var $username = $("#username");
			var $password = $("#password");
			var $validateCode = $("#validateCode");
			
			
			// 记住用户名
			if(getCookie("adminUsername") != null) {
				$isRememberUsername.prop("checked", true);
				$username.val(getCookie("adminUsername"));
				$password.focus();
			} else {
				$isRememberUsername.prop("checked", false);
				$username.focus();
			}
			// 表单验证、记住用户名
			$("#loginForm").submit( function() {
				if ($username.val() == "") {
					layer.tips("用户名不能空",$username);
					return false;
				}
				if ($password.val() == "") {
					layer.tips("密码不能空",$password);
					return false;
				}
				if ($validateCode.val() == "") {
					layer.tips("请输入验证码",$validateCode);
					return false;
				}
				
				if ($isRememberUsername.prop("checked")) {
					addCookie("adminUsername", $username.val(), {expires: 7 * 24 * 60 * 60});
				} else {
					removeCookie("adminUsername");
				}
			});
		});
		// 如果在框架中，则跳转刷新上级页面
		if(self.frameElement && self.frameElement.tagName=="IFRAME"){
			parent.location.reload();
		}
	</script>

	</head>
	<body>
		
    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="#"><img src="${base}/static/admin/images/logo.gif" alt="baisu Admin" style="height:40px;"></a>
        </div>
      </div>
    </div>

    <div class="container main">
		<!--[if lte IE 6]><br/><div class='alert alert-block' style="text-align:left;padding-bottom:10px;"><a class="close" data-dismiss="alert">x</a><h4>温馨提示：</h4><p>你使用的浏览器版本过低。为了获得更好的浏览体验，我们强烈建议您 <a href="http://browsehappy.com" target="_blank">升级</a> 到最新版本的IE浏览器，或者使用较新版本的 Chrome、Firefox、Safari 等。</p></div><![endif]-->
		
		<div id="messageBox" class="alert alert-error hide"><button data-dismiss="alert" class="close">×</button>
			<label id="loginError" class="error"></label>
		</div>
        <div id="login-wraper">
            <form id="loginForm"  class="form login-form" action="login" method="post">
                <fieldset><legend><span style="color:#08c;">系统登录</span></legend></fieldset>
                <div class="body">
					<div class="control-group">
						<div class="controls">
							<input type="text" id="username" name="username" class="required" value="" placeholder="登录名">
						</div>
					</div>
					<div class="control-group">
						<div class="controls">
							<input type="password" id="password" name="password" class="required" placeholder="密码"/>
						</div>
					</div>
					[#if isShowValidateCode]
						<div class="control-group">
							<div class="controls validateCode">
								<label for="validateCode">验&nbsp;&nbsp;证&nbsp;&nbsp;码：</label>
								<input type="text" id="validateCode" name="validateCode" maxlength="5" class="txt required" style="font-weight:bold;width:45px;margin-bottom:0;" placeholder="验证码"/>
								<img src="${base}/admin/main/captcha-image?timestamp="'" + (new Date()).valueOf()+'"' onclick="$('.validateCodeRefresh').click();" class="mid validateCodeImg .validateCode verify"/>
								<a href="javascript:" onclick="$('.validateCodeImg').attr('src','${base}/admin/main/captcha-image?timestamp='+new Date().getTime());" class="mid validateCodeRefresh">看不清</a>
							</div>
						</div>
					[/#if]
                </div>
                <div class="footer">
                    <label class="checkbox inline">
                        <input type="checkbox" id="rememberMe" name="rememberMe"> <span style="color:#08c;">记住我</span>
                    </label>
                    <input class="btn btn-primary" type="submit" value="登 录"/>
                </div>
				<div id="themeSwitch" class="dropdown pull-right">
					<a class="dropdown-toggle" data-toggle="dropdown" href="#">默认主题<b class="caret"></b></a>
					<ul class="dropdown-menu">
					  <li><a href="#" onclick="location='zsl/theme/default?url='+location.href">默认主题</a></li><li><a href="#" onclick="location='zsl/theme/cerulean?url='+location.href">天蓝主题</a></li><li><a href="#" onclick="location='zsl/theme/readable?url='+location.href">橙色主题</a></li><li><a href="#" onclick="location='zsl/theme/united?url='+location.href">红色主题</a></li><li><a href="#" onclick="location='zsl/theme/flat?url='+location.href">Flat主题</a></li>
					</ul>
					<!--[if lte IE 6]><script type="text/javascript">$('#themeSwitch').hide();</script><![endif]-->
				</div>
            </form>
        </div>
    </div>
   [#include "/admin/include/footer.htm"]
  
	</body>
</html>
